home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Wildcat Files 2
/
The Wildcat Files 2 (Arsenal Computer).ISO
/
qm-util
/
mailrun.scr
< prev
next >
Wrap
Text File
|
1994-04-02
|
8KB
|
163 lines
; This script will make an unattended mail run to pick up Tomcat mail and send
; any new mail waiting to be sent. Make sure you edit DIALTXT, NAME, MAXTRIES,
; and TCLOGOFF in the DEFINITIONS section (leave UDONE and DDONE alone) to
; meet your requirements!
;
; IMPORTANT: You must have HotKeys turned off and Expert mode turned on in
; your user profile on the BBS, and also make sure the packet name is defined
; in the FON book entry for the system you will be calling before using this
; script.
;
; Modified from the script listed in the QmodemPro 1.00 manual. Feel free
; to make any modifications you wish. If you make it better, then share it
; with everyone else!
;
TurnOn 8_BIT
TurnOff LINEFEED
TurnOff XON/XOFF
TurnOff NOISE
TurnOff MUSIC
TurnOn SCROLL
TurnOff PRINT
TurnOff ECHO
Capture MAILRUN.CAP
Log MAILRUN.LOG
;
; ------------------------ DEFINITIONS -------------------------
;
String NAME UDONE DDONE DOOR MAXTRIES FONTXT TCLOGOFF DIALTXT
Assign DIALTXT "My Hub" ; unique text string from FON file
Assign NAME "!Logon Name PASSWORD" ; Name and Password on BBS
Assign UDONE N ; Upload done?
Assign DDONE N ; Download done?
Assign MAXTRIES 5 ; Maximum attempts to connect
Assign TCLOGOFF N ; set this to Y if you have logoff
; after upload set to Y in Tomcat,
; N if you do not
;
; --------------------- END DEFINITIONS ------------------------
;
Restart: ; Go here if the connection gets
; broken then stamp log
Stamp NO CARRIER detected, restarting script
; Notes:
; The DIAL command uses the ability to call a specific number, without
; knowing the exact position in the .FON file. The example DIALTXT set up
; in this script will search the .FON file for the text "MSI HQ". By using
; the Text dial option and specifying this, it will dial this number even
; if the FON book is sorted. Note the 'T' prefix in the DIAL line below...
;-----
; Dial section starts here
;-----
Decr MAXTRIES ; decrement the counter
If "$MAXTRIES" = "0" TooManyTries ; if none left goto TooManyTries
If $ONLINE SkipDial ; skip the dial if online already
Dial "T$DIALTXT" ; dial selected entry
SkipDial:
TimeOut 1200 OutOfTime ; set Waitfor timeout to 1200 seconds
Goto Top ; jump to start of main body
OutOfTime: ; come here if something times out
Hangup ; hang up the phone
Delay 5000 ; wait 5 seconds
Hangup ; hang up again (just in case)
Delay 5000 ; wait 5 seconds
Goto Restart ; start over again
;-----
; Main Body starts here
;-----
Top: ; label for main body of script
When "NO CARRIER" Restart ; goto label restart if fails
When "[S]top?" "S^M" ; send S Enter at any pause prompt
When "[L]ist mail, or [C]on" "C^M" ; send C Enter at mail notice
Waitfor "irst name" ; wait for first name prompt
Delay 100 ; delay .1 second
Send "$NAME^M" ; send text from Define section
Waitfor "TOMCAT MENU" ; wait for the Tomcat menu prompt
;-----
CmdLoop: ; label for command loop
If "$DDONE" = "N" DoDownload ; download not done, do it
If "$UDONE" = "N" DoUpload ; upload not done, do it
Goto AllDoneN ; only if both of above are done
;-----
DoDownload: ; label for download section
When "nothing found to d" DownloadOK ; go to label if no msgs to download
Send "^M" ; send ENTER for check
Waitfor "TOMCAT MENU" ; wait for menu again
Delay 2000 ; wait 2 seconds
Send "D^M" ; send D ENTER for download
Waitfor "receive this packet" ; wait until packet is ready
Delay 100 ; delay .1 second
Send "Y^M" ; answer Y ENTER
Waitfor "$PACKET.QWK" ; wait until it's ready to send
Stamp Beginning download of $QWKPATH$PACKET.QWK ; stamp log
Download Z $QWKPATH$PACKET.QWK ; start the download
If $SUCCESS DownloadOK ; if ok, branch to label
Stamp Download FAILED ; make note in log that it failed
Goto DoDownload ; and do it again
;-----
DownloadOK: ; label for OK downloads
Stamp Download successful ; make note in log that it was a success
Assign DDONE Y ; change download flag to Y
Goto CmdLoop ; branch back to Command Loop
;-----
DoUpload: ; label for upload section
Delay 2000 ; wait for 2 seconds
Send "^M" ; send ENTER key
Waitfor "TOMCAT MENU" ; wait for Tomcat menu prompt
Delay 100 ; wait .1 second
Exist $REPPATH$PACKET.REP SendMsgs ; if there are messages to send then
; goto SendMsgs
Assign UDONE Y ; if no messages to send, flag that
; uploading is done
Goto CmdLoop ; and branch back to Command Loop
;-----
SendMsgs: ; label for SendMsgs section
Send "U^M" ; send U ENTER
Waitfor "$PACKET.REP" ; wait until Tomcat is ready
Pause 1000 ; wait 1 second
Upload Z $REPPATH$PACKET.REP ; start the upload
If $FAIL DoUpload ; if not OK then do it again
DeleteF $REPPATH$PACKET.REP ; delete the .rep file
If "$TCLOGOFF" = "Y" AllDoneY ; if Tomcat set to logoff after upload
; branch to AllDoneY
Assign UDONE Y ; set upload flag to Y
;-----
AllDoneN: ; label when up and downloads are done
When ; cancels all previous When tracking
Send "^M" ; send ENTER
Waitfor "TOMCAT MENU" ; wait for menu
Send "G^M" ; send G ENTER to logoff
Goto EndGame ; branch to EndGame label
;-----
AllDoneY:
When ; stop tracking all previous WHENs
When "Auto Logoff" "H^M" ; send H ENTER to logoff
Assign UDONE Y ; set the upload done flag
;-----
EndGame: ; label for end of script
Hangup ; hangup the modem
Delay 2000 ; wait 2 seconds
Send "ATM0H1^M" ; take modem offhook
TurnOff Log ; close the log file
System Y ; exit back to DOS
Exit ; end of script (if successful)
;-----
TooManyTries:
Stamp "Mail attempt failed..." ; place notice in log file
TurnOff Log ; close the log file
Exit ; end of script (if failure)